package org.example.order.domain;

public class OrderDomainService {
    private final OrderRepository orderRepository;

    public OrderDomainService(OrderRepository orderRepository) {
        this.orderRepository = orderRepository;
    }

    public Order getOrder(String orderId) {
        Order order = orderRepository.getOrder(orderId);
        if (order == null) {
            throw new OrderDomainException(DomainErrorCode.ORDER_NOT_FOUND, orderId);
        }
        return order;
    }
}
